package com.village.zpark.pojo;

import com.village.zpark.common.DateUtil;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

@Data
@Table(name="facility")
public class Facility {
    @Id
    @Column(name="id")
    private Integer id;
    @Column(name="facilityname")
    private String facilityname;//设施名称
    @Column(name="facilitytype")
    private String facilitytype;//设施类型
    @Column(name="location")
    private String location;//设施位置
    @Column(name="builddate")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date builddate;//设施建造日期
    @Column(name="maintaindate")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date maintaindate;//设施维护日期
    @Column(name="status")
    private String status;//设施状态
    @Column(name="description")
    private String description;//设施描述
    public String getBuilddateStr() {
        return DateUtil.dateConvert(builddate);
    }
    public String getMaintaindateStr() {
        return DateUtil.dateConvert(maintaindate);
    }
}
